import axios from 'axios';
import type { TableData } from '@arco-design/web-vue/es/table/interface';

export interface ContentDataRecord {
  x: string;
  y: number;
}

export function queryContentData() {
  return axios.get<ContentDataRecord[]>('/api/content-data');
}

export interface PopularRecord {
  key: number;
  clickNumber: string;
  title: string;
  increases: number;
}

export function queryPopularList(params: { type: string }) {
  return axios.get<TableData[]>('/api/popular/list', { params });
}

//数据中心
//文档类型列表
export function getDocTypeList(data: any) {
  return axios.get('/doc_type/index', {
    params: data,
  });
}
// 文档类型详情
export function getDocTypeDetails(data: any) {
  return axios.get('/doc_type/detail', {
    params: data,
  });
}
// 添加文档类型
export function addDocType(data: any) {
  return axios.post('/doc_type/add', data);
}
//编辑文档类型
export function editDocType(data: any) {
  return axios.post('/doc_type/edit', data);
}
//删除文档类型
export function deleteDocType(data: any) {
  return axios.post('/doc_type/delete', data);
}

//档案类别管理
// 档案类比列表
export function getarchiveCategory(data: any) {
  return axios.get('/archive_category/index', {
    params: data,
  });
}
// 档案类别详情
export function getArchiveCategory(data: any) {
  return axios.get('/archive_category/detail', {
    params: data,
  });
}

// add档案类别
export function addArchiveCategory(data: any) {
  return axios.post('/archive_category/add', data);
}
//edit档案类别
export function editArchiveCategory(data: any) {
  return axios.post('/archive_category/edit', data);
}
//deelte档案类别
export function deleteArchiveCategory(data: any) {
  return axios.post('/archive_category/delete', data);
}

//档案类别号
// 档案类比号列表
export function getarchiveCategorysss(data: any) {
  return axios.get('/archive_category_code/index', {
    params: data,
  });
}
// 档案类别号详情
export function getArchiveCategorysss(data: any) {
  return axios.get('/archive_category_code/detail', {
    params: data,
  });
}
// add档案类别号
export function addArchiveCategorysss(data: any) {
  return axios.post('/archive_category_code/add', data);
}
//edit档案类别号
export function editArchiveCategorysss(data: any) {
  return axios.post('/archive_category_code/edit', data);
}
//deelte档案类别号
export function deleteArchiveCategoryssss(data: any) {
  return axios.post('/archive_category_code/delete', data);
}

//档案保存期限管理
// 档案保存期限列表
export function getArchiveStoreLife(data: any) {
  return axios.get('/archive_store_life/index', {
    params: data,
  });
}
// 档案保存期限详情
export function getArchiveStoreLifeDetails(data: any) {
  return axios.get('/archive_store_life/detail', {
    params: data,
  });
}
// 添加档案保存期限
export function addArchiveStoreLife(data: any) {
  return axios.post('/archive_store_life/add', data);
}
//编辑档案保存期限
export function editArchiveStoreLife(data: any) {
  return axios.post('/archive_store_life/edit', data);
}
//删除档案保存期限
export function deleteArchiveStoreLife(data: any) {
  return axios.post('/archive_store_life/delete', data);
}

//流程分类
// 获取流程列表
export function getApprovalCategorType(data: any) {
  return axios.get('/approval_category/index', {
    params: data,
  });
}
// 获取流程类型详情
export function getcatgoryDetail(data: any) {
  return axios.get('/approval_category/detail', {
    params: data,
  });
}
// 获取流程类型所有
export function getAllApprovalCat(data?: any) {
  return axios.get('/approval_flow/types', {
    params: data,
  });
}
// 获取所有预设条件
export function getAllfields(data: any) {
  return axios.get('/approval_flow/fields', {
    params: data,
  });
}
// 添加流程类型所有
export function addApprovalCatfory(data: any) {
  return axios.post('/approval_category/add', data);
}
//编辑流程类型所有
export function editArchivestoreLife(data: any) {
  return axios.post('/approval_category/edit', data);
}
//删除流程类型所有
export function deleteapprivaor(data: any) {
  return axios.post('/approval_category/delete', data);
}

// 获取政策领域列表
export function getPolicyarticleDetail(data: any) {
  return axios.get('/policy/detail', {
    params: data,
  });
}
// 获取政策领域列表
export function getpolicyIndex(data: any) {
  return axios.get('/policy_field/index', {
    params: data,
  });
}
// 获取政策领域详情
export function getpolicydetail(data: any) {
  return axios.get('/policy_field/detail', {
    params: data,
  });
}
// 添加政策领域
export function addpolicyfile(data: any) {
  return axios.post('/policy_field/add', data);
}
// 编辑政策领域
export function editpplicy(data: any) {
  return axios.post('/policy_field/edit', data);
}
// 删除政策领域
export function deletePolicy(data: any) {
  return axios.post('/policy_field/delete', data);
}

// 获取政策部门列表
export function getpolicydeplist(data: any) {
  return axios.get('/policy_dept/index', {
    params: data,
  });
}
// 获取政策领域详情
export function getpolicy_dept(data: any) {
  return axios.get('/policy_dept/detail', {
    params: data,
  });
}
// 添加政策部门
export function addpolicydept(data: any) {
  return axios.post('/policy_dept/add', data);
}
// 编辑政策领域
export function editpolicydept(data: any) {
  return axios.post('/policy_dept/edit', data);
}
// 删除政策领域
export function deletePolicydept(data: any) {
  return axios.post('/policy_dept/delete', data);
}

// 政策行业
// 获取政策行业列表
export function getindustry(data: any) {
  return axios.get('/policy_industry/index', {
    params: data,
  });
}
// 获取政策行业详情
export function getpolicy_industrydetail(data: any) {
  return axios.get('policy_industry/detail', {
    params: data,
  });
}
// 添加政策行业
export function addpolicy_industry(data: any) {
  return axios.post('/policy_industry/add', data);
}
// 编辑政策行业
export function editpolicy_industry(data: any) {
  return axios.post('/policy_industry/edit', data);
}
// 删除政策行业
export function deletepolicy_industry(data: any) {
  return axios.post('/policy_industry/delete', data);
}

// 政策方向
// 获取政策方向列表
export function getpolicy_direction(data: any) {
  return axios.get('/policy_direction/index', {
    params: data,
  });
}
// 获取政策领域详情
export function getdirectiondetail(data: any) {
  return axios.get('policy_direction/detail', {
    params: data,
  });
}
// 添加政策领域
export function addpolicy_direction(data: any) {
  return axios.post('/policy_direction/add', data);
}
// 编辑政策领域
export function editpolicy_direction(data: any) {
  return axios.post('/policy_direction/edit', data);
}
// 删除政策领域
export function deletepolicy_direction(data: any) {
  return axios.post('/policy_direction/delete', data);
}
